﻿

var mStorageEvidenceList_Query = {};

$(function () {

    packQuery();

    $('#storageEvidenceGrid').datagrid({
        url: '/BaseData/LoadStorageEvidenceList',
        fitColumns: true,
        rownumbers: true,
        resizable: true,
        pagination: true,
        pageNumber: 1,
        pageSize: 20,
        nowrap: false,
        height: 540,
        idField: 'Id',
        toolbar: '#storageEvidenceToolbar',
        queryParams: { 'StorageEvidenceList_Query': JSON.stringify(mStorageEvidenceList_Query) },
        singleSelect: true,
        //onDblClickRow: selStockRow,
        columns: [[
               { title: 'Id', field: 'Id', align: 'center', width: 10, hidden: true },
               { title: '保管单位', field: 'ManageDeptName', align: 'left', width: 150, formatter: gFormatDeptNameForColumn },
               { title: '仓位', field: 'StorageName', align: 'left', width: 150 },
               { title: '案件编号', field: 'CaseNo', align: 'left', width: 150 },
               { title: '办案单位', field: 'TransferDeptName', align: 'left', width: 150, formatter: gFormatDeptNameForColumn },
               { title: '物品', field: 'EvidenceName', align: 'left', width: 200 },
               { title: '数量', field: 'Qty', align: 'right', width: 100 },
               { title: '所有人', field: 'OwnerName', align: 'left', width: 70 }

        ]]
    });
});

//打包参数
function packQuery() {
    mStorageEvidenceList_Query.StorageName = $('#txtStorageName').val();
    mStorageEvidenceList_Query.CaseNo = $('#txtCaseNo').val();
    mStorageEvidenceList_Query.EvidenceName = $('#txtEvidenceName').val();
}



function searchStorageEvidenceAction() {
    loadStorageEvidenceList();
}

function loadStorageEvidenceList() {
    try {
        packQuery();
        var json = JSON.stringify(mStorageEvidenceList_Query);
        $('#storageEvidenceGrid').datagrid('reload', { 'StorageEvidenceList_Query': json });

    } catch (ex) {
        $.messager.alert('提示', ex);
    }
}
